<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
 </head>
 <body>
	<!--1 、判断大于0、小于0、等于0 -->
	 <input type="text" id="num1">
	 <input type="button" value="判断" onclick="dayu()"><br>
	<!--2、判断奇数、偶数 -->
	 <input type="text" id="num2">
	 <input type="button" value="判断" onclick="jiou()"><br>
	<!--3、 计算体重 -->
	 <input type="text" id="num3">
	 <input type="text" id="num4">
	 <input type="button" value="判断" onclick="jisuan()"><br>
    <!--4、 计算闰年 -->
    <input type="text" id="num5">
	 <input type="button" value="判断" onclick="suan()"><br>
  <script>
  //1
 function dayu(){
	var x = num1.value;
		if(x>0){	
		document.write("大于0");
		}
		else if(x<0){
		document.write("小于0");
		}
		else if(x==0){
		document.write("等于0");
		}
 }
//2
 function jiou(){
	var x = num2.value;
		if(x%2==0){
		document.write("偶数");
		}
		else if(x%2==1){
		document.write("奇数");
		}
 }
//3
 function jisuan(){  
	 var h = num3.value;
	 var y = num4.value;
	 var z =(h-108)*2;
	 var x = y-z;
	 if(x<=10&&x>=-10){
	 document.write("合格");
 }
		 else
		 {document.write("不合格");
		 }
 }
//4
 function suan(){
	 var x = num5.value;
		 if(x%400==0 || (x%4==0 && !(x%100==0))){
		 document.write("闰年");
		 }
		 else{
		 document.write("非闰年");
		}	
	}
  </script>

 </body>
</html>
